file1=open("d:\\1.csv")
map2022={}
for line in file1:
    word=line.strip()
    t=word.split(",")
    if t[0] in map2022:
        map2022[t[0]]+=float(t[1])
    else:
        map2022[t[0]]=float(t[1])
fout2022=open("D:\\2022_region_out.csv","w")
for key in map2022:
    line=str(key)+","+str(map2022[key])+"\n"
    fout2022.write(line)
fout2022.close()


file2=open("d:\\2.csv")
map2023={}
for line in file2:
    word=line.strip()
    t=word.split(",")
    if t[0] in map2023:
        map2023[t[0]]+=float(t[1])
    else:
        map2023[t[0]]=float(t[1])
fout2023=open("D:\\2023_region_out.csv","w")
for  key in map2023:
    line=str(key)+","+str(map2023[key])+"\n"
    fout2023.write(line)
fout2023.close()







